package utils;

/**
 * Created by Administrator on 2017/6/3.
 */

public class CommonUtil {

    // 风值转化为风向
    public static String flow2StrName(double x) {
        if (x >= 348.76 || x <= 11.25) {
            return "北";
        } else if (x <= 33.75) {
            return "北东北";
        } else if (x <= 56.25) {
            return "东北";
        } else if (x <= 78.75) {
            return "东东北";
        } else if (x <= 101.25) {
            return "东";
        } else if (x <= 123.75) {
            return "东东南";
        } else if (x <= 146.25) {
            return "东南";
        } else if (x <= 168.75) {
            return "南东南";
        } else if (x <= 191.25) {
            return "南";
        } else if (x <= 213.75) {
            return "南西南";
        } else if (x <= 236.25) {
            return "西南";
        } else if (x <= 258.75) {
            return "西西南";
        } else if (x <= 281.25) {
            return "西";
        } else if (x <= 303.75) {
            return "西西北";
        } else if (x <= 326.25) {
            return "西北";
        } else if (x <= 348.75) {
            return "北西北";
        }

        return "";
    }
}
